/*
 * This class split the input String and can add it to a WordList object. 
 */
package cth.tda367.beavers.glossaryGame.model;

import java.util.ArrayList;
import java.util.List;

import javax.swing.JOptionPane;

import cth.tda367.beavers.glossaryGame.IO.FileCreator;



public class LanguageInput {

	List<String> Language = new ArrayList<String>();
	
	public LanguageInput(){
	
	}
	
	public WordList toWordList(){
		WordList wordList = new WordList();
		for(int i = 0; i < (Language.size())/2; i++){
			wordList.addNewWord(new Word(Language.get(i), Language.get(i+1)));
			i++; 
			
		}
		return wordList;
	}

	public void addToLanguage(String buffert){
		String[] splitbuffert = buffert.split(",");
		Language.add(splitbuffert[0]);
		Language.add(splitbuffert[1]);
	}
	
}
